<section class="content-header">
    <h1>
        {{title}}
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-3 col-md-push-9">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">查询区域</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="form-group">
                        <label for="DateTimeRange">时间</label>
                        <input type="text" class="form-control pull-right" id="DateTimeRange" placeholder="请选择日期" />
                    </div>
                    <div class="form-group">
                        <label>区域</label>
                        <dx-select-box #subArea style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="subAreaItems" displayExpr="subArea"
                            [(selectedItem)]="subAareSelected" (onValueChanged)="onSubAreaSelectedChange($event)" [value]="subAreaItems[0]"
                            [searchEnabled]="true">
                        </dx-select-box>
                    </div>
                    <div class="form-group">
                        <label>设备</label>
                        <dx-select-box style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="equipemntItems" displayExpr="equipment"
                            [(selectedItem)]="equipmentSelected" [value]="equipmentSelected" [searchEnabled]="true">
                        </dx-select-box>
                    </div>
                    <div class="form-group">
                        <label>班次</label>
                        <dx-select-box #shift style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="shiftItems" displayExpr="shiftName"
                            [(selectedItem)]="shiftSelected" [value]="shiftItems[0]" [searchEnabled]="true">
                        </dx-select-box>
                    </div>
                </div>
                <div class="box-footer">
                    <button type="button" class="btn btn-primary" (click)="getReportData()"> 查 询 </button>
                </div>
            </div>
        </div>
        <div class="col-md-9 col-md-pull-3">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">{{title}}查询</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <dx-data-grid [dataSource]="ctsList" [showColumnLines]="true" [showRowLines]="true" [showBorders]="true" 
                    [rowAlternationEnabled]="true" (onExporting)="onExporting($event)" [columnMinWidth]="50" [columnAutoWidth]="true">
                        <dxo-paging [pageSize]="10"></dxo-paging>
                        <dxo-export [enabled]="true" fileName="CT明细查询" [allowExportSelectedData]="false"></dxo-export>
                        <dxo-pager [showPageSizeSelector]="true" [allowedPageSizes]="[10, 20, 100]" [showInfo]="true">
                        </dxo-pager>
                        <dxi-column dataField="logTime" caption="logTime">
                        </dxi-column>
                        <dxi-column dataField="area" caption="区域">
                        </dxi-column>
                        <dxi-column dataField="subArea" caption="subArea">
                        </dxi-column>
                        <dxi-column dataField="equipment" caption="设备">
                        </dxi-column>
                        <dxi-column dataField="valid" caption="valid">
                        </dxi-column>
                        <dxi-column dataField="oktoWork" caption="OKtoWork">
                        </dxi-column>
                        <dxi-column dataField="autoCycle" caption="autoCycle">
                        </dxi-column>
                        <!-- <dxi-column dataField="fault" caption="fault">
                        </dxi-column> -->
                        <dxi-column dataField="lastCt" caption="lastCt(0.1S)">
                        </dxi-column>
                        <dxi-column dataField="lastBt" caption="lastBt(0.1S)">
                        </dxi-column>
                        <dxi-column dataField="lastSt" caption="lastSt(0.1S)">
                        </dxi-column>
                        <dxi-column *ngIf="showUpload" dataField="lastLoad" caption="lastLoad">
                        </dxi-column>
                        <dxi-column *ngIf="showUpload" dataField="lastUnload" caption="lastUnload">
                        </dxi-column>
                        <dxi-column dataField="lastPartType" caption="lastPartType">
                        </dxi-column>
                        <dxi-column dataField="gd" caption="GD">
                        </dxi-column>
                        <dxi-column dataField="rj" caption="RJ">
                        </dxi-column>
                        <dxi-column dataField="shiftDay" caption="shiftDay">
                        </dxi-column>
                        <dxi-column dataField="shiftId" caption="shiftId">
                        </dxi-column>

                    </dx-data-grid>
                </div>
            </div>
        </div>
    </div>
</section>